home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / CommResources.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  8.2 KB  |  440 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CommResources.a
  3. ;
  4. ;    Contains:    Communications Toolbox Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__COMMRESOURCES__') = 'UNDEFINED' THEN
  21. __COMMRESOURCES__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  25.     include 'OSUtils.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'Memory.a'                                            ;
  31.  
  32. ;    tool classes (also the tool file types)    
  33. classCM                            EQU        'cbnd'
  34. classFT                            EQU        'fbnd'
  35. classTM                            EQU        'tbnd'
  36.  
  37. ;    version of the Comm Resource Manager    
  38. curCRMVersion                    EQU        2
  39. ; constants general to the use of the Communications Resource Manager 
  40. crmType                            EQU        9                    ; queue type    
  41. crmRecVersion                    EQU        1                    ; version of queue structure 
  42. ;    error codes 
  43. crmGenericError                    EQU        -1
  44. crmNoErr                        EQU        0
  45.  
  46. ; data structures general to the use of the Communications Resource Manager 
  47. ; typedef OSErr             CRMErr
  48. CRMRec                     RECORD    0
  49. qLink                     ds.l   1        ; offset: $0 (0)        ;reserved
  50. qType                     ds.w   1        ; offset: $4 (4)        ;queue type -- ORD(crmType) = 9
  51. crmVersion                 ds.w   1        ; offset: $6 (6)        ;version of queue element data structure
  52. crmPrivate                 ds.l   1        ; offset: $8 (8)        ;reserved
  53. crmReserved                 ds.w   1        ; offset: $C (12)        ;reserved
  54. crmDeviceType             ds.l   1        ; offset: $E (14)        ;type of device, assigned by DTS
  55. crmDeviceID                 ds.l   1        ; offset: $12 (18)        ;device ID; assigned when CRMInstall is called
  56. crmAttributes             ds.l   1        ; offset: $16 (22)        ;pointer to attribute block
  57. crmStatus                 ds.l   1        ; offset: $1A (26)        ;status variable - device specific
  58. crmRefCon                 ds.l   1        ; offset: $1E (30)        ;for device private use
  59. sizeof                     EQU *            ; size:   $22 (34)
  60.                         ENDR
  61.  
  62. ; typedef struct CRMRec     CRMRec
  63. ; typedef CRMRec             *CRMRecPtr
  64. ;
  65. ; pascal CRMErr InitCRM(void)
  66. ;
  67.     IF ¬ GENERATINGCFM THEN
  68.         Macro
  69.         _InitCRM
  70.             move.w    #$0501,-(sp)
  71.             dc.w     $204F
  72.             dc.w     $A08B
  73.             dc.w     $544F
  74.         EndM
  75.     ELSE
  76.         IMPORT_CFM_FUNCTION    InitCRM
  77.     ENDIF
  78.  
  79. ;
  80. ; pascal QHdrPtr CRMGetHeader(void)
  81. ;
  82.     IF ¬ GENERATINGCFM THEN
  83.         Macro
  84.         _CRMGetHeader
  85.             move.w    #$0502,-(sp)
  86.             dc.w     $204F
  87.             dc.w     $A08B
  88.             dc.w     $544F
  89.         EndM
  90.     ELSE
  91.         IMPORT_CFM_FUNCTION    CRMGetHeader
  92.     ENDIF
  93.  
  94. ;
  95. ; pascal void CRMInstall(CRMRecPtr crmReqPtr)
  96. ;
  97.     IF ¬ GENERATINGCFM THEN
  98.         Macro
  99.         _CRMInstall
  100.             move.w    #$0503,-(sp)
  101.             dc.w     $204F
  102.             dc.w     $A08B
  103.             dc.w     $544F
  104.         EndM
  105.     ELSE
  106.         IMPORT_CFM_FUNCTION    CRMInstall
  107.     ENDIF
  108.  
  109. ;
  110. ; pascal OSErr CRMRemove(CRMRecPtr crmReqPtr)
  111. ;
  112.     IF ¬ GENERATINGCFM THEN
  113.         Macro
  114.         _CRMRemove
  115.             move.w    #$0504,-(sp)
  116.             dc.w     $204F
  117.             dc.w     $A08B
  118.             dc.w     $544F
  119.         EndM
  120.     ELSE
  121.         IMPORT_CFM_FUNCTION    CRMRemove
  122.     ENDIF
  123.  
  124. ;
  125. ; pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr)
  126. ;
  127.     IF ¬ GENERATINGCFM THEN
  128.         Macro
  129.         _CRMSearch
  130.             move.w    #$0505,-(sp)
  131.             dc.w     $204F
  132.             dc.w     $A08B
  133.             dc.w     $544F
  134.         EndM
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION    CRMSearch
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal short CRMGetCRMVersion(void)
  141. ;
  142.     IF ¬ GENERATINGCFM THEN
  143.         Macro
  144.         _CRMGetCRMVersion
  145.             move.w    #$0506,-(sp)
  146.             dc.w     $204F
  147.             dc.w     $A08B
  148.             dc.w     $544F
  149.         EndM
  150.     ELSE
  151.         IMPORT_CFM_FUNCTION    CRMGetCRMVersion
  152.     ENDIF
  153.  
  154. ;
  155. ; pascal Handle CRMGetResource(ResType theType, short theID)
  156. ;
  157.     IF ¬ GENERATINGCFM THEN
  158.         Macro
  159.         _CRMGetResource
  160.             move.w    #$0507,-(sp)
  161.             dc.w     $204F
  162.             dc.w     $A08B
  163.             dc.w     $544F
  164.         EndM
  165.     ELSE
  166.         IMPORT_CFM_FUNCTION    CRMGetResource
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal Handle CRMGet1Resource(ResType theType, short theID)
  171. ;
  172.     IF ¬ GENERATINGCFM THEN
  173.         Macro
  174.         _CRMGet1Resource
  175.             move.w    #$0508,-(sp)
  176.             dc.w     $204F
  177.             dc.w     $A08B
  178.             dc.w     $544F
  179.         EndM
  180.     ELSE
  181.         IMPORT_CFM_FUNCTION    CRMGet1Resource
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal Handle CRMGetIndResource(ResType theType, short index)
  186. ;
  187.     IF ¬ GENERATINGCFM THEN
  188.         Macro
  189.         _CRMGetIndResource
  190.             move.w    #$0509,-(sp)
  191.             dc.w     $204F
  192.             dc.w     $A08B
  193.             dc.w     $544F
  194.         EndM
  195.     ELSE
  196.         IMPORT_CFM_FUNCTION    CRMGetIndResource
  197.     ENDIF
  198.  
  199. ;
  200. ; pascal Handle CRMGet1IndResource(ResType theType, short index)
  201. ;
  202.     IF ¬ GENERATINGCFM THEN
  203.         Macro
  204.         _CRMGet1IndResource
  205.             move.w    #$050A,-(sp)
  206.             dc.w     $204F
  207.             dc.w     $A08B
  208.             dc.w     $544F
  209.         EndM
  210.     ELSE
  211.         IMPORT_CFM_FUNCTION    CRMGet1IndResource
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name)
  216. ;
  217.     IF ¬ GENERATINGCFM THEN
  218.         Macro
  219.         _CRMGetNamedResource
  220.             move.w    #$050B,-(sp)
  221.             dc.w     $204F
  222.             dc.w     $A08B
  223.             dc.w     $544F
  224.         EndM
  225.     ELSE
  226.         IMPORT_CFM_FUNCTION    CRMGetNamedResource
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name)
  231. ;
  232.     IF ¬ GENERATINGCFM THEN
  233.         Macro
  234.         _CRMGet1NamedResource
  235.             move.w    #$050C,-(sp)
  236.             dc.w     $204F
  237.             dc.w     $A08B
  238.             dc.w     $544F
  239.         EndM
  240.     ELSE
  241.         IMPORT_CFM_FUNCTION    CRMGet1NamedResource
  242.     ENDIF
  243.  
  244. ;
  245. ; pascal void CRMReleaseResource(Handle theHandle)
  246. ;
  247.     IF ¬ GENERATINGCFM THEN
  248.         Macro
  249.         _CRMReleaseResource
  250.             move.w    #$050D,-(sp)
  251.             dc.w     $204F
  252.             dc.w     $A08B
  253.             dc.w     $544F
  254.         EndM
  255.     ELSE
  256.         IMPORT_CFM_FUNCTION    CRMReleaseResource
  257.     ENDIF
  258.  
  259. ;
  260. ; pascal Handle CRMGetToolResource(short procID, ResType theType, short theID)
  261. ;
  262.     IF ¬ GENERATINGCFM THEN
  263.         Macro
  264.         _CRMGetToolResource
  265.             move.w    #$0523,-(sp)
  266.             dc.w     $204F
  267.             dc.w     $A08B
  268.             dc.w     $544F
  269.         EndM
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION    CRMGetToolResource
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name)
  276. ;
  277.     IF ¬ GENERATINGCFM THEN
  278.         Macro
  279.         _CRMGetToolNamedResource
  280.             move.w    #$0526,-(sp)
  281.             dc.w     $204F
  282.             dc.w     $A08B
  283.             dc.w     $544F
  284.         EndM
  285.     ELSE
  286.         IMPORT_CFM_FUNCTION    CRMGetToolNamedResource
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal void CRMReleaseToolResource(short procID, Handle theHandle)
  291. ;
  292.     IF ¬ GENERATINGCFM THEN
  293.         Macro
  294.         _CRMReleaseToolResource
  295.             move.w    #$0524,-(sp)
  296.             dc.w     $204F
  297.             dc.w     $A08B
  298.             dc.w     $544F
  299.         EndM
  300.     ELSE
  301.         IMPORT_CFM_FUNCTION    CRMReleaseToolResource
  302.     ENDIF
  303.  
  304. ;
  305. ; pascal long CRMGetIndex(Handle theHandle)
  306. ;
  307.     IF ¬ GENERATINGCFM THEN
  308.         Macro
  309.         _CRMGetIndex
  310.             move.w    #$050E,-(sp)
  311.             dc.w     $204F
  312.             dc.w     $A08B
  313.             dc.w     $544F
  314.         EndM
  315.     ELSE
  316.         IMPORT_CFM_FUNCTION    CRMGetIndex
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID)
  321. ;
  322.     IF ¬ GENERATINGCFM THEN
  323.         Macro
  324.         _CRMLocalToRealID
  325.             move.w    #$050F,-(sp)
  326.             dc.w     $204F
  327.             dc.w     $A08B
  328.             dc.w     $544F
  329.         EndM
  330.     ELSE
  331.         IMPORT_CFM_FUNCTION    CRMLocalToRealID
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID)
  336. ;
  337.     IF ¬ GENERATINGCFM THEN
  338.         Macro
  339.         _CRMRealToLocalID
  340.             move.w    #$0510,-(sp)
  341.             dc.w     $204F
  342.             dc.w     $A08B
  343.             dc.w     $544F
  344.         EndM
  345.     ELSE
  346.         IMPORT_CFM_FUNCTION    CRMRealToLocalID
  347.     ENDIF
  348.  
  349. ;
  350. ; pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName)
  351. ;
  352.     IF ¬ GENERATINGCFM THEN
  353.         Macro
  354.         _CRMGetIndToolName
  355.             move.w    #$0511,-(sp)
  356.             dc.w     $204F
  357.             dc.w     $A08B
  358.             dc.w     $544F
  359.         EndM
  360.     ELSE
  361.         IMPORT_CFM_FUNCTION    CRMGetIndToolName
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID)
  366. ;
  367.     IF ¬ GENERATINGCFM THEN
  368.         Macro
  369.         _CRMFindCommunications
  370.             move.w    #$051A,-(sp)
  371.             dc.w     $204F
  372.             dc.w     $A08B
  373.             dc.w     $544F
  374.         EndM
  375.     ELSE
  376.         IMPORT_CFM_FUNCTION    CRMFindCommunications
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName)
  381. ;
  382.     IF ¬ GENERATINGCFM THEN
  383.         Macro
  384.         _CRMIsDriverOpen
  385.             move.w    #$0521,-(sp)
  386.             dc.w     $204F
  387.             dc.w     $A08B
  388.             dc.w     $544F
  389.         EndM
  390.     ELSE
  391.         IMPORT_CFM_FUNCTION    CRMIsDriverOpen
  392.     ENDIF
  393.  
  394. ;
  395. ; pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value)
  396. ;
  397.     IF ¬ GENERATINGCFM THEN
  398.         Macro
  399.         _CRMParseCAPSResource
  400.             move.w    #$0525,-(sp)
  401.             dc.w     $204F
  402.             dc.w     $A08B
  403.             dc.w     $544F
  404.         EndM
  405.     ELSE
  406.         IMPORT_CFM_FUNCTION    CRMParseCAPSResource
  407.     ENDIF
  408.  
  409. ;
  410. ; pascal OSErr CRMReserveRF(short refNum)
  411. ;
  412.     IF ¬ GENERATINGCFM THEN
  413.         Macro
  414.         _CRMReserveRF
  415.             move.w    #$0513,-(sp)
  416.             dc.w     $204F
  417.             dc.w     $A08B
  418.             dc.w     $544F
  419.         EndM
  420.     ELSE
  421.         IMPORT_CFM_FUNCTION    CRMReserveRF
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal OSErr CRMReleaseRF(short refNum)
  426. ;
  427.     IF ¬ GENERATINGCFM THEN
  428.         Macro
  429.         _CRMReleaseRF
  430.             move.w    #$0514,-(sp)
  431.             dc.w     $204F
  432.             dc.w     $A08B
  433.             dc.w     $544F
  434.         EndM
  435.     ELSE
  436.         IMPORT_CFM_FUNCTION    CRMReleaseRF
  437.     ENDIF
  438.  
  439.     ENDIF ; __COMMRESOURCES__
  440.